#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""TestPlatformWeb URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
# from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.views.static import serve

from rest_framework.documentation import include_docs_urls
from rest_framework_jwt.views import obtain_jwt_token, verify_jwt_token, refresh_jwt_token

# import xadmin
from apps.users.views import IndexView, user_logout, LoginView
from graphene_django.views import GraphQLView

urlpatterns = [
    # path('admin/', xadmin.site.urls),
    path('', IndexView.as_view(), name='index'),
    path('login', obtain_jwt_token),
    path('verify/', verify_jwt_token),
    path('refresh/', refresh_jwt_token),
    # path('api_token_auth/', views.obtain_auth_token),
    path('logout/', user_logout, name='logout'),

    # rest_framework
    # path('api_auth/', include('rest_framework.urls')),
    path('graph/', GraphQLView.as_view(graphiql=True)),

    # drf文档，title自定义
    path('docs', include_docs_urls(title='接口文档', authentication_classes=[],
                                   permission_classes=[])),

    # 项目路由配置
    path('project/', include('project.urls', namespace='project')),

    # 测试用例路由配置
    path('case/', include('case.urls', namespace='case')),

    # 测试用例结果路由配置
    path('caseResult/', include('case.case_result_urls', namespace='case_result')),

    # 测试计划路由配置
    path('plan/', include('plan.urls', namespace='plan')),

    # 计划用例路由配置
    path('planCase/', include('plan.case_urls', namespace='plan_case')),

    # 测试环境路由配置
    path('env/', include('env.urls', namespace='env')),

    # 测试报告路由配置
    path('report/', include('report.urls', namespace='report')),

    # step接口路由配置
    path('step/', include('steps.urls', namespace='step')),

    # 前置步骤路由
    path('preStep/', include('steps.pre_step_urls', namespace='preStep')),

    # interface路由配置
    path('interface/', include('interface.urls', namespace='interface')),

    # dataBase路由配置
    path('database/', include('database.urls', namespace='dateBase'))
]

